//
//  CTPFlickrTiledFetcher.m
//  citipad
//
//  Created by Chih Yuan Liu on 3/5/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "CTPFlickrTiledFetcher.h"


@implementation CTPFlickrTiledFetcher

- (void)requestSucceeded {
	[delegate flickrTiledFetcherSucceeded: self data:recievedData];
	[delegate flickrTiledFetcherEnd:self];
}

-(void)requestFailed:(NSError*)error {
	[delegate flickrTiledFetcherFailed:self];
	[delegate flickrTiledFetcherEnd:self];
}

-(NSString*) URLForCtpProxy:(NSString*) tags{
	NSString* url = [NSString stringWithFormat:
					 @"http://114.34.48.246/CtpSvr/svr.ashx?method=ftile&key=%@", 
					 tags];
	return url;
}

-(void)getDataFromCtp:(NSString*) tags{
	NSString* url = [self URLForCtpProxy:tags];
	NSLog(@"%@", url);
	[super requestGET:url];
	[delegate flickrTiledFetcherBegin:self];
}


@synthesize delegate;


@end
